import React from 'react';

import LiftingStateUpUnit from './LiftingStateUpUnit.js';

class LiftingStateUp extends React.Component{

	constructor(props){
		super(props);
		this.state = {
			value : 0
		};
		this.setValueHandler = this.setValue.bind(this);
	}

	setValue(v){
		this.setState(
				{ value: v}
			);
		console.log("v:"+v);
	}
	render(){

		return (
				<div>
				<h3>LiftingStateUp</h3>
				<form>
					<LiftingStateUpUnit unit='元' value={this.state.value} parentSetValueHandler={this.setValueHandler}/>
					<LiftingStateUpUnit unit='角' value={this.state.value} parentSetValueHandler={this.setValueHandler}/>
					<LiftingStateUpUnit unit='分' value={this.state.value} parentSetValueHandler={this.setValueHandler}/>
				</form>
				</div>
				
			);
	}
}
export default LiftingStateUp;